package com.ruoyi.his.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.his.domain.HisPatient;
import com.ruoyi.his.mapper.HisPatientMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.his.mapper.HisOutpatientQueueMapper;
import com.ruoyi.his.domain.HisOutpatientQueue;
import com.ruoyi.his.service.IHisOutpatientQueueService;

/**
 * 患者队列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-05
 */
@Service
public class HisOutpatientQueueServiceImpl implements IHisOutpatientQueueService 
{
    @Autowired
    private HisOutpatientQueueMapper hisOutpatientQueueMapper;

    @Autowired
    private HisPatientMapper hisPatientMapper;


    @Override
    public int updateQueueStatus(Map data) {

        int i = hisOutpatientQueueMapper.updateQueueStatus(data);
        return i;
    }

    /**
     * 新增患者队列表
     * 
     * @param hisOutpatientQueue 患者队列表
     * @return 结果
     */
    @Override
    public int insertHisOutpatientQueue(HisOutpatientQueue hisOutpatientQueue)
    {
        return hisOutpatientQueueMapper.insertHisOutpatientQueue(hisOutpatientQueue);
    }

    /**
     * 通过用户id查询门诊排队
     *
     * @param userId 用户id
     * @return {@link List}<{@link Map}<{@link String}, {@link Object}>>
     */
    @Override
    public List<Map<String, Object>> queryOutpatientQueueByUserId(String userId) {
        return hisOutpatientQueueMapper.queryOutpatientQueueByUserId(userId);
    }

    /**
     * 根据病人就诊卡查询病人信息
     * @param cardId
     * @return
     */
    @Override
    public HisPatient queryHisPatientByCardId(String cardId) {
        return hisPatientMapper.queryHisPatientByCardId(cardId);
    }

    @Override
    public int updataOutpatientInfo(Map data) {
        return hisOutpatientQueueMapper.updataOutpatientInfo(data);
    }


}
